﻿// =================================================================== 
// 项目说明
//====================================================================
// 
// 文件： BS_AREA.cs
// 项目名称：

// 创建时间：2013/3/19
// 负责人：
// ===================================================================
using System;
using System.Collections;
using System.Collections.Generic;
using System.Data;
using System.Data.SqlClient;
using System.Text;
using CommonLib.Model;
using CommonLib.IDAL;


namespace MSSQLDAL
{
    /// <summary>
    /// 数据层实例化接口类  .
    /// </summary>
    public partial class BS_AREADAL : IBS_AREADAL
    {
		//此处写查询数据的sql语句，


        //if QueryDataString==""，DAL层的GetList，GetRecordCount等函数将直接存取BS_AREA表


        //if QueryDataString!=""，则DAL层的GetList，GetRecordCount等函数将存取该SQL语句，取代表
		//注意：所写sql语句执行结果的字段必须是唯一的


		private const string QueryDataString = "";

        public DataSet GetListSub(string sWhere, string sOder)
        {
            string sqlStr = "select AREA_ID,AREA_NAME ,( case when AREA_ID  in (select PARENT_ID from BS_AREA) then 1 else 0 end) as leaf  from " + TableString;
            if (sWhere.Length > 0)
                sqlStr += " where " + sWhere;
            if (sOder.Length > 0)
                sqlStr += " order by " + sOder;
            return SqlHelper.ExecuteDataset(Conn.SqlConnStr, CommandType.Text, sqlStr);
        }
	}
}

